/**
 * Created by ${PRODUCT_NAME}.
 * User: skylerparr
 * Date: 12/26/10
 * Time: 11:52 AM
 * To change this template use File | Settings | File Templates.
 */
package com.thoughtorigin.loader {
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.system.LoaderContext;

public class AbstractLoader extends EventDispatcher {

    private var _url: String;
    private var _loaderContext: LoaderContext;
    private var _isLoading: Boolean;
    private var _isPaused: Boolean;
    private var _urlRequest: URLRequest;

    public function AbstractLoader(url: String) {
        _url = url;
        _urlRequest = new URLRequest(url);
    }

    public function get url(): String {
        return _url;
    }

    protected function get urlRequest(): URLRequest {
        return _urlRequest;
    }

    public function set requestMethod(value: String): void {
        value = value.toUpperCase();
        if(value == URLRequestMethod.GET) {
            _urlRequest.method = value;
        } else if(value == URLRequestMethod.POST) {
            _urlRequest.method = value;
        }
    }

    public function get requestMethod(): String {
        return _urlRequest.method;
    }

    public function set loaderContext(value: LoaderContext): void {
        _loaderContext = value;
    }

    public function get loaderContext(): LoaderContext {
        return _loaderContext;
    }

    protected function set isLoading(value: Boolean): void {
        _isLoading = value;
    }

    protected function get isLoading(): Boolean {
       return _isLoading;
    }

    protected function get isPaused(): Boolean {
        return _isPaused;
    }

    protected function set isPaused(value: Boolean): void {
        _isPaused = value;
    }

    public function start(): void {

    }

    public function stop(): void {

    }

    public function pause(): void {

    }

    public function resume(): void {

    }

    public function add(absLoader: AbstractLoader): void {

    }

    public function remove(absLoader: AbstractLoader): void {

    }

    public function insert(absLoader: AbstractLoader, index: int): void {

    }

    public function get content(): * {

    }

    /**
     * could be Loader or URLLoader
     */
    public function get loader(): * {

    }

    public function get contentDispatcher():IEventDispatcher {
        return null;
    }

}
}
